package com.java83.service.impl;

import com.java83.domain.LzhServiceLog;
import com.java83.domain.LzhServicer;
import com.java83.domain.MyDto;
import com.java83.mapper.LzhServiceLogMapper;
import com.java83.mapper.LzhServicerMapper;
import com.java83.service.PeopleService;
import com.ruoyi.system.api.RemoteUserService;
import com.ruoyi.system.api.domain.SysUser;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import cn.hutool.extra.mail.MailUtil;
import org.springframework.stereotype.Service;


/**
 * @Author lzh
 * @Description
 * @Date 2022/2/22 19:49
 */
@Service
public class PeopleServiceImpl implements PeopleService {
//    @Autowired
//    RedisTemplate redisTemplate;
    @Autowired
    RabbitTemplate rabbit;
    @Autowired
    LzhServicerMapper lzhServicerMapper;
    public boolean send(int id,LzhServiceLog lzhServiceLog){
        System.out.println(id);
        //Message helloMessage = new Message((id+"").getBytes(), new MessageProperties());
        Long sid = lzhServiceLog.getSid();
        LzhServicer lzhServicer = lzhServicerMapper.selectLzhServicerById(sid);
        MailUtil.send("956618277@qq.com", "测试", "邮件来自Hutool测试", false);
        rabbit.convertAndSend("exchangetopic", "email",lzhServiceLog);
        return false;
    }
}
